const express = require('express')
const app = express()

const bodyParser = require('body-parser')
const session = require('express-session')
const { userListRouter } = require('./controller/userAdminProject/userListRouter')

/* 接口  跨域  中间件*/

app.use((req, res, next) => {
    res.header("Access-Control-Allow-Origin", "*");
    next()
})

/*  body-parser session */
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: false }))
app.use(session({
    secret: 'keyboard cat',
    resave: false,
    saveUninitialized: true
}))

// 管理系统项目路由配置

app.use('/useradmin', userListRouter)



app.listen(3002)